package cn.test.my.excel;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;

/**
 * @author summit
 * @since 2021/7/1 15:51
 */
public class Excel {

	public static void main(String[] args) throws FileNotFoundException {
		List<PartyCapitalExcelDTO> partyCapitalDataList = new ArrayList<>();
		PartyCapitalExcelDTO dto = new PartyCapitalExcelDTO();
		dto.setReportOwner("测试");
	//	partyCapitalDataList.add(dto);
		ExcelWriter excelWriter = EasyExcel.write(new File("D:/11.xlsx")).withTemplate(
						new FileInputStream("D:\\tongyu-workspace\\zheqi\\cloud3\\yhdr-report-service\\src\\main\\resources\\reports\\partyCapital.xlsx")).build();
		WriteSheet writeSheet = EasyExcel.writerSheet().build();
		FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
		//excelWriter.fill(new FillWrapper("s1", partyCapitalDataList), fillConfig, writeSheet);

		excelWriter.finish();
	}
}
